class Message{
    constructor(code, data, message = '') {
        this.code = code
        this.data = data
        this.message = message
        this.timestamp = new Date().getTime()
    }
    static sendSuccess(data = null, message = '操作成功') {
        return new Message(200, data, message)
    }
    static sendFail(message = '操作失败') {
        return new Message(500, null, message)
    }
}
module.exports = Message
